Propagating Separable Equalities in an MDD Store
نویسندگان
چکیده
We present a propagator that achieves MDD consistency for a separable equality over an MDD (multivalued decision diagram) store in pseudo-polynomial time. We integrate the propagator into a constraint solver based on an MDD store introduced in [1]. Our experiments show that the new propagator provides substantial computational advantage over propagation of two inequality constraints, and that the advantage increases when the maximum width of the MDD store increases. In [1] we proposed a width-limited multivalued decision diagram (MDD) as a general constraint store for constraint programming. We demonstrated the potential of MDD-based constraint solving by developing MDD-propagators for alldiff and inequality constraints. In this paper, we describe an MDD-propagator for the separable equality constraint that uses a pseudo-polynomial algorithm to achieve MDD consistency. We show the computational advantage of the new propagator over the existing approach of modeling equalities with two inequality propagators. Preliminaries. A constraint satisfaction problem is specified with a set of constraints C = {C1, . . . , Cm} on the variables X = {x1, . . . , xn} with respective finite domains D1, . . . , Dn. An MDD M is a tuple (V, r, E, var, D), where V is a set of vertices containing the special terminal vertex 1 and a root r ∈ V , E ⊆ V ×V is a set of edges such that (V,E) forms a directed acyclic graph with r as the source and 1 as the sink for all maximal paths in the graph. Further, var : V → {1, . . . , n+1} is a labeling of all nodes with a variable index, with var(1) = n+ 1. D is a set containing an edge domain Duv for each edge (u, v). We require that ∅ 6= Duv ⊆ Dvar(u) for all edges in E, and for convenience we take Duv = ∅ if (u, v) 6∈ E. We work only with ordered MDDs. A total ordering < of the variables is assumed, and all edges (u, v) with v 6= 1 respect the ordering; that is, var(u) < var(v). For convenience, we assume that the variables in X are ordered according to their indices. Ordered MDDs can be viewed as arranged in n layers of vertices, with the vertices on each layer labeled with the same variable index. The width k of the MDD is the size of the largest layer. While MDDs in general allow edges to skip layers, for the simplicity of representation in this paper we consider only MDDs without long edges; that is, for each (u, v) ∈ E, var(v) = var(u) + 1. Thus if an r → 1 path is defined to be a path u1, . . . , un+1 in which u1 = r and un+1 = 1, then each r → 1 path represents the subset of solutions ∏n i=1(Duiui+1). Let C be a constraint on the variables {x1, . . . , xn}. For a given MDD M we have a notion of consistency that generalizes well known generalized arc consistency (GAC) [2]. Definition 1 (MDD consistency). A constraint C is MDD consistent with respect to M if, for every edge (u, v) ∈ E with i = var(u) and every value αi ∈ Duv, there exists a tuple (α1, . . . , αn) satisfying C that is represented by an r → 1 path passing through (u, v). 1 A Propagator for the Separable Equality Constraint Unlike a standard domain-store propagator, which is specified only by the way it prunes infeasible values from a domain-store, an MDD-store propagator also refines the MDD representing the store by adding new vertices and edges. We develop such a propagator for the separable equality constraint, which for a set of unary functions f1, . . . , fn and a constant c is defined as f1(x1) + f2(x2) + . . .+ fn(xn) = c (1) 1.1 Pruning One simple way to perform pruning on the constraint (1) is to do so for the two inequality constraints ∑n i=1 fi(xi) ≤ c and ∑n i=1 fi(xi) ≥ c. We can achieve MDD consistency in linear time in the size of the MDD for each of these separately, using the inequality propagator described in [1]. Yet this ensures only that each remaining edge is on a shortest path with cost at most c and on a longest path with cost at least c. It therefore does not achieve MDD consistency for the equality constraint. To achieve MDD consistency we use the following procedure. In the first phase, for each node u the algorithm computes the cost Ldown(u) of the cheapest path and the cost Hdown(u) of the most expensive path leading from u to the terminal. In the second phase it marks the edges in the MDD store that are on at least one r → 1 path representing a solution of the constraint. In the final phase all unmarked edges are removed from the MDD. The pseudo-code for the algorithm Mark-Support implements the second phase with a dynamic programming recursion and is shown in Figure 1. It is initially invoked on the root r and the right-hand side c. When invoked on a node u it searches for a path through the MDD from u with the given cost. For each edge (u, u) and α ∈ Du,u′ , the algorithm recursively checks if there exists a path of cost c−fvar(u)(α) from u ′ to the terminal, and the result of this query is cached as cache(u, c−fvar(u′)(α)). If the result is positive the edge is marked to indicate that it must not be pruned. For each node u the previously computed Ldown(u) and Hdown(u) values provide an early cutoff, because there can be no path of cost c from u if the cheapest path from u is too expensive or the most expensive path is too cheap. Note that if the width of the MDD store is 1 then the algorithm is essentially the domain store filter of [3]. Mark-Support(u, cost) 1 if cache(u, cost) 6= UNKNOWN 2 then return cache(u, cost) 3 else if Ldown(u) > cost ∨Hdown(u) < cost 4 then cache(u, cost)← false 5 return false 6 else for (u, u, α) ∈ E ×Du,u′ 7 do if Mark-Support(u, cost− fvar(u)(α)) 8 then marked← marked ∪ (u, u, α) 9 cache(u, cost)← true 10 return cache(u, cost) Fig. 1. The algorithm shown above, initially invoked as Mark-Support(r, c) for a constraint ∑ 1≤i≤n fi(xi) = c, ensures that an edge along with a value from its edge domain is in marked iff there is a path through that edge, using the corresponding value with cost exactly c. Complexity The complexity of a propagation step is dominated by the execution of Mark-Support as the other phases can be done in linear time. Since each call to Mark-Support only does constant work in addition to the recursive calls, we can evaluate the time based on the number of recursive calls alone. A call to Mark-Support on a node u only results in recursive calls if the given cost has not been processed before for u. Let Lup(u) and Hup(u) be the cost of the cheapest and most expensive path from the root to u. Then an upper bounds on the number q(u) of distinct costs that any node u will be queried for is q(u) = c−Lup(u)− (c−Hup(u)) + 1 = Hup(u)− Lup(u) + 1. Hence the total time over all nodes can be bounded by
منابع مشابه
A Constraint Store Based on Multivalued Decision Diagrams
The typical constraint store transmits a limited amount of information because it consists only of variable domains. We propose a richer constraint store in the form of a limited-width multivalued decision diagram (MDD). It reduces to a traditional domain store when the maximum width is one but allows greater pruning of the search tree for larger widths. MDD propagation algorithms can be develo...
متن کاملSome rank equalities for finitely many tripotent matrices
A rank equality is established for the sum of finitely many tripotent matrices via elementary block matrix operations. Moreover, by using this equality and Theorems 8 and 10 in [Chen M. and et al. On the open problem related to rank equalities for the sum of finitely many idempotent matrices and its applications, The Scientific World Journal 2014 (2014), Article ID 702413, 7 page...
متن کاملA Systematic Approach to MDD-Based Constraint Programming
Fixed-width MDDs were introduced recently as a more refined alternative for the domain store to represent partial solutions to CSPs. In this work, we present a systematic approach to MDD-based constraint programming. First, we introduce a generic scheme for constraint propagation in MDDs. We show that all previously known propagation algorithms for MDDs can be expressed using this scheme. Moreo...
متن کاملInference for Product Competition and Separable Demand
This paper presents a methodology for identifying groups of products that exhibit similar patterns in demand and responsiveness to changes in price using store-level sales data. We use the concept of economic separability as an identification condition for different product groups, and build a weakly separable model of aggregate demand. A common issue with separable demand models is that the pa...
متن کاملSynergistic Effects of Depression and Poor Impulse Control on Physical Partner Violence; A National Longitudinal Study in United States
Background: Although major depressive disorder (MDD) also increases the risk of Intimate Partner Violence (IPV) perpetration, poor mental health has been mostly conceptualized as a consequence of IPV victimization rather than a risk factor for IPV perpetration. Poor impulse control is another IPV risk factor. Building on a risk / risk framework, this study investigates additive and multiplicati...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2008